package cn.sciento.starter.tenant.custom.configuration;

import cn.sciento.core.redis.RedisHelper;
import cn.sciento.starter.tenant.custom.core.TenantCustomPostProcessor;
import cn.sciento.starter.tenant.custom.repository.TenantCustomPointRepository;
import cn.sciento.starter.tenant.custom.repository.impl.DefaultTenantCustomPointRepository;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@ComponentScan({"cn.sciento.starter.tenant.custom.endpoint", "cn.sciento.starter.tenant.custom.filter"})
@Configuration
public class TenantCustomConfiguration {
  @Bean
  @ConditionalOnMissingBean
  public TenantCustomPointRepository tenantCustomPointRepository(RedisHelper redisHelper) {
    return new DefaultTenantCustomPointRepository(redisHelper);
  }
  
  @Bean
  public TenantCustomPostProcessor tenantCustomPostProcessor() {
    return new TenantCustomPostProcessor();
  }
}
